package dialog;

import java.util.Calendar;

import model.Todo;
import android.app.TimePickerDialog;
import android.app.TimePickerDialog.OnTimeSetListener;
import android.content.Context;

public class TodoTimeDialog {
	
	private Context context = null;
	private TimePickerDialog dialog = null;

	public TodoTimeDialog(
			Context context, 
			OnTimeSetListener listener) {
		this.context = context;
		
		Calendar cal = Calendar.getInstance();
		dialog = new TimePickerDialog(
				this.context, 
				listener, 
				cal.get(Calendar.HOUR_OF_DAY), 
				cal.get(Calendar.MINUTE), 
				true);
	}

	public TodoTimeDialog(
			Context context, 
			OnTimeSetListener listener, 
			Todo todo) {
		this.context = context;
		
		dialog = new TimePickerDialog(
				this.context, 
				listener, 
				todo.getHour(), 
				todo.getMinute(), 
				true);
	}
	
	public void show() {
		dialog.show();
	}
}
